﻿@model CodeFinder.Common.Entities.Post
@{
    ViewBag.Title = "Create";
}
@Html.HiddenFor(x => x.Id)
<div class="editor-label">
    @Html.LabelFor(model => model.Title)
</div>
<div class="editor-field">
    @Html.TextBoxFor(model => model.Title, new {
    @class = "title"
})
    @Html.ValidationMessageFor(model => model.Title)
</div>
<div class="editor-label">
    @Html.LabelFor(model => model.Content)
</div>
<div class="editor-field">
    @Html.TextAreaFor(model => model.Content, new {
    @id = "content",
    @class = "richEditor"
})
    @Html.ValidationMessageFor(model => model.Content)
</div>
<div class="editor-label">
    @Html.HiddenFor(x => x.CreatedOn)
</div>
<div class="editor-label">
    @Html.LabelFor(model => model.CreatedBy)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.CreatedBy)
    @Html.ValidationMessageFor(model => model.CreatedBy)
</div>
<div class="editor-label">
    @Html.LabelFor(model => model.ViewScope)
</div>
<div class="editor-field">
    @*@Html.EditorFor(model => model.ViewScope)*@
    @Html.DropDownListFor(x => x.ViewScope, (IEnumerable<SelectListItem>)ViewBag.ViewScopes)
    @Html.ValidationMessageFor(model => model.ViewScope)
</div>
<div class="editor-label">
    @Html.LabelFor(model => model.Category, "Category")
</div>
<div class="editor-field">
    @Html.DropDownListFor(x => x.Category, (IEnumerable<SelectListItem>)ViewBag.Categories)
    @Html.ValidationMessageFor(model => model.Category)
</div>
<script language="javascript" type="text/javascript">
    $(function () {
        $('#content').htmlarea({
            loaded: function () {
                var newWidth = this.toolbar.parent().css('width');
                this.toolbar.css('width', newWidth);
            }
        });
    });
</script>
